﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Edit.Master" AutoEventWireup="true" CodeBehind="SinglewellStatisticsChartView.aspx.cs" Inherits="Web.Views.SingleWellManage.SinglewellStatisticsChartView" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../../Highcharts/highcharts.js" type="text/javascript"></script>
    <script type="text/javascript">

        var showData;

        $(function () {

            $.post(
                '../../HttpHandles/SinglewellStatisticsHandler.aspx?op=getsinglewellstastistics',
                {

                },
                function (data, statusText) {
                    showData = new Array(data.length);
                    for (var i = 0; i < data.length; i++) {
                        showData[i] = [data[i].WORKMODE == "" ? "空" : data[i].WORKMODE, parseInt(data[i].RCOUNT)];
                    }

                    $("#divchart").highcharts({
                        
                        title: {
                            text: '单井资料分类统计'
                        },
                        tooltip: {
                            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
                        },
                        plotOptions: {
                            pie: {
                                allowPointSelect: true,
                                cursor: 'pointer',
                                dataLabels: {
                                    enabled: true,
                                    color: '#000000',
                                    connectorColor: '#000000',
                                    format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                                },
                                showInLegend: true
                            }
                        },
                        legend: {
                            layout: 'vertical',
                            align: 'right',
                            verticalAlign: 'middle',
                            borderWidth: 0,
                            x: -150,
                            labelFormatter: function () {
                                return "<strong style='font-size:14px;'> " + this.name + "</strong>：共计 " + this.y + " 条";
                            }
                        },
                        series: [
                            {
                                type: 'pie',
                                name: '分类统计比率',
                                data: showData
                            }
                        ]

                    });
                }
            );


        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="button" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="edit" runat="server">
    <div id="divchart">
    </div>
</asp:Content>
